﻿<local:DocumentBase x:Class="WPFExcelReport.YCAAV25"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:ad="clr-namespace:AvalonDock;assembly=AvalonDock" 
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                    xmlns:fd="clr-namespace:Labs.Filtering;assembly=ReflectionStudio.Core"
                    xmlns:db="clr-namespace:INTEX.DataBase"
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
                    xmlns:me="clr-namespace:WPFExcelReport"
                    xmlns:exc="clr-namespace:IntexReportStudio.UserControls"
                    Height="700" Width="1024" 
                    FontSize="14"
                   Background="White"
                    Loaded="Window_Loaded"
     >
    <local:DocumentBase.Resources>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:TextTrimmingConverter  x:Key="Trim"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:String2ColorConverter  x:Key="str2color"/>
        <ucd:PreisConverter  x:Key="PreisConverter"/>
        <ucd:PNumConverter  x:Key="pnum"/>
        <db:SETINTEXDB  x:Key="SetData" />
        <db:SETINTEXDB  x:Key="SetProd" />
        <db:SETINTEXDB  x:Key="SetEnv" />
        <CollectionViewSource   x:Key="vwLIEFDAT" Source="{Binding Path=LIEFDAT,Source={StaticResource SetEnv}}" />
        <CollectionViewSource   x:Key="vwFSSTAMM" Source="{Binding Path=FSSTAMM,Source={StaticResource SetEnv}}" />
        <CollectionViewSource   x:Key="vwABPAUF" Source="{Binding Path=ABPAUF,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwABPOS" Source="{Binding Path=ABPOS,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwWDECK" Source="{Binding Path=WDECK,Source={StaticResource SetProd}}" />
        <CollectionViewSource   x:Key="vwFDECK" Source="{Binding Path=FDECK,Source={StaticResource SetProd}}" />
    </local:DocumentBase.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition   Height="Auto" />
            <RowDefinition   Height="Auto" />
            <RowDefinition   Height="*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition  Width="2*" />
            <ColumnDefinition Width="1*"/>
        </Grid.ColumnDefinitions>
        <StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2">           
            <WrapPanel >

                <StackPanel>
                    <WrapPanel >
                    <TextBlock Width="Auto" Height="Auto" FontSize="18">款号</TextBlock>
                        <TextBox Name="txtABPART" Background="White"  FontSize="18" HorizontalAlignment="Left"  KeyUp="txtABPART_KeyUp" Margin="3"  Width="200"  />
                        <Button  Width="40" Height="40" Click="cmdLoad_Click">
                            <Button.Background>
                                <ImageBrush  ImageSource="Image/Search.png" />
                            </Button.Background>
                        </Button>
                        <TextBlock Width="Auto" Height="Auto" FontSize="18">生产单</TextBlock>
                        <ComboBox  ItemsSource="{Binding Source={StaticResource ResourceKey=vwABPAUF}}"
                            Margin="10,0,0,0"  FontSize="18"
                               SelectionChanged="ABP_SelectionChanged"
                               Background="White"  MinWidth="300" 
                               DisplayMemberPath="ABPAUF"
                               IsEditable="True"
                               SelectedValuePath="ABPAUF"
                       />
                    </WrapPanel >                    
                       <WrapPanel >
                        <TextBlock Width="Auto" Height="Auto"  FontSize="18"  HorizontalAlignment="Stretch" VerticalAlignment="Center">款式</TextBlock>
                        <TextBox Name="txtFSABEZ" Background="White"  HorizontalAlignment="Left" Margin="3"   Width="200"   FontSize="18"/>
                        <Grid Margin="20,0,0,0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="80"></ColumnDefinition>
                                <ColumnDefinition Width="130"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <TextBlock Grid.Column="0" FontSize="18" FontWeight="Bold"   HorizontalAlignment="Stretch" VerticalAlignment="Center">收货</TextBlock>
                            <TextBox Grid.Column="1"  Margin="3"  Background="White"  Name="txtQty" KeyUp="txtQty_KeyUp"  
                                     Text="{Binding Path=ABPEAKG, Source={StaticResource ResourceKey=vwABPOS}}" FontSize="18" Width="120"/>
                            <WrapPanel Margin="15,0,0,0" Grid.Column="2">
                                <Button   Width="40" Height="40" Click="cmdNewEntry_Click">
                                    <Button.Background>
                                        <ImageBrush  ImageSource="Image/Save.png" />
                                    </Button.Background>
                                </Button>
                            </WrapPanel>
                        </Grid>
                        <Grid Margin="20,0,0,0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="40"></ColumnDefinition>
                                <ColumnDefinition Width="40"></ColumnDefinition>
                                <ColumnDefinition Width="80"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <TextBlock Grid.Column="0" FontSize="18" FontWeight="Bold"  HorizontalAlignment="Stretch" VerticalAlignment="Center">库位</TextBlock>
                            <TextBox Grid.Column="1"  Margin="3"  Background="White"  Name="txtLO" FontSize="18" HorizontalAlignment="Stretch" VerticalAlignment="Center"
                                     Text="01"
                                      />
                            <TextBox Grid.Column="2"  Margin="3"  Background="White"  Name="txtLB" FontSize="18"  HorizontalAlignment="Stretch" VerticalAlignment="Center" 
                                     Text="KC"
                                     />
                            <TextBox Grid.Column="3"  Margin="3"  Background="White"  Name="txtLP" FontSize="18"  HorizontalAlignment="Stretch" VerticalAlignment="Center"  Text="01"/>
                        </Grid>
                    </WrapPanel >
        </StackPanel>  
            </WrapPanel>
            <me:DABPOS DataContext="{StaticResource ResourceKey=vwABPOS}" Width="1000" HorizontalAlignment="Left"></me:DABPOS>
        </StackPanel>
        <DockPanel  Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="1" >
            <StackPanel DockPanel.Dock="Bottom"  IsEnabled="False" Visibility="Hidden"> 
                <TextBlock>面料需求</TextBlock>
                <DataGrid  
                              AutoGenerateColumns="False"
                              EnableRowVirtualization="True"          
                    Name="dlgWDECK"
                              ItemsSource="{Binding Source={StaticResource ResourceKey=vwWDECK}}"
                              HeadersVisibility="Column"
                              ScrollViewer.HorizontalScrollBarVisibility="Auto"
                              ScrollViewer.VerticalScrollBarVisibility="Auto"  
                              >
                    <DataGrid.Columns>
                        <DataGridTextColumn Binding="{Binding Path=WDAUFPOS}" Header="行"  Width="Auto" MinWidth="100"/>
                        <DataGridTextColumn Binding="{Binding Path=WDART}" Header="面料"  Width="Auto" MinWidth="100"/>
                        <DataGridTextColumn Binding="{Binding Path=WDFARBE}" Header="颜色"  Width="Auto" MinWidth="100"/>
                        <DataGridTextColumn Binding="{Binding Path=WDBEDARF,Converter={StaticResource ResourceKey=d100}}" Header="需求数"  Width="Auto" MinWidth="40"/>
                    </DataGrid.Columns>
                </DataGrid>
                <TextBlock>辅料需求</TextBlock>
                <DataGrid  
                    AutoGenerateColumns="False"
                    EnableRowVirtualization="True"                             
                    ItemsSource="{Binding Source={StaticResource ResourceKey=vwFDECK}}"
                    HeadersVisibility="Column"
                    Name="dlgFDECK"
                    ScrollViewer.HorizontalScrollBarVisibility="Auto"
                    ScrollViewer.VerticalScrollBarVisibility="Auto"  
                    >
                    <DataGrid.Columns>
                        <DataGridTextColumn Binding="{Binding Path=FDAUFPOS}" Header="行"  Width="Auto" MinWidth="100"/>
                        <DataGridTextColumn Binding="{Binding Path=FDART}" Header="面料"  Width="Auto" MinWidth="100"/>
                        <DataGridTextColumn Binding="{Binding Path=FDFARBE}" Header="颜色"  Width="Auto" MinWidth="100"/>
                        <DataGridTextColumn Binding="{Binding Path=FDGROE}" Header="尺寸"  Width="Auto" MinWidth="100"/>
                        <DataGridTextColumn Binding="{Binding Path=FDMENGE}" Header="需求数"  Width="Auto" MinWidth="40"/>
                    </DataGrid.Columns>
                </DataGrid>
            </StackPanel>
            <DataGrid Grid.Row="1"
                              AutoGenerateColumns="False"
                              EnableRowVirtualization="True"  
                              Name="dlgKD"
                              ItemsSource="{Binding Source={StaticResource ResourceKey=vwABPOS}}"
                              HeadersVisibility="Column"
                              ScrollViewer.HorizontalScrollBarVisibility="Auto"
                              ScrollViewer.VerticalScrollBarVisibility="Auto"  
                              >
                <DataGrid.Columns>
                    <DataGridTextColumn Binding="{Binding Path=ABPAUFKRS}" Header=""  Width="Auto" MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=ABPAUFLFD,Converter={StaticResource ResourceKey=pnum}}" Header="生产单"  Width="Auto" MinWidth="60"/>
                    <DataGridTextColumn Binding="{Binding Path=ABPAUFPOS,Converter={StaticResource ResourceKey=pnum}}" Header=""  Width="Auto" MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=ABPLIEFNR,Converter={StaticResource ResourceKey=pnum}}" Header="制衣厂"  Width="Auto" MinWidth="100"/>
                    <DataGridTextColumn Binding="{Binding Path=FSABEZ,Converter={StaticResource ResourceKey=Trim}}" Header="款式"  Width="Auto" MinWidth="120"/>
                    <DataGridTextColumn Binding="{Binding Path=ABPFARBE}" Header="颜色"  Width="Auto" MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=ABPGROE}" Header="尺寸"  Width="Auto" MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=ABPSOLLMENGE7,Converter={StaticResource ResourceKey=d100}}" Header="计划"  Width="Auto" MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=ABPEALFM,Converter={StaticResource ResourceKey=d100}}" Header="已入"  Width="Auto" MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=ABPEAKG}" Header="本次"  Width="Auto" MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=ABPERLKZ}" Header="完成"  Width="Auto" MinWidth="40"/>                    
                </DataGrid.Columns>
            </DataGrid>
        </DockPanel>
        <DockPanel  Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="1">
            <StackPanel DockPanel.Dock="Top">
                <TextBlock>待处理</TextBlock>
                <ListView Name="list01">              
                </ListView>
                <TextBlock>转换队列</TextBlock>
                <ListView Name="list02">
                </ListView>
            </StackPanel>
            <Expander DockPanel.Dock="Bottom" ExpandDirection="Down">
                <exc:EventLog   x:Name="_LogExplorerDock" ></exc:EventLog>
            </Expander>
        </DockPanel>
    </Grid>
</local:DocumentBase>